import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
const Login = ()=>import('views/Login.vue')
const Profile = ()=>import('views/Profile.vue')
const Market = ()=>import('views/Market.vue')
const Register = ()=>import('views/Register.vue')
const Mdetail = ()=>import('views/Mdetail.vue')
Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta:{
      requireLogin:false,
      title:'首页',
      showTabbar: true
    }
  },
  {
    path: '/mdetail/:name',
    name: 'Mdetail',
    component: Mdetail,
    meta:{
      requireLogin:false,
      title:'资金详情',
      showTabbar: false
    }
  },
  {
    path:'/login',
    name:'Login',
    component:Login,
    meta:{
      requireLogin:false,
      title:'登录',
      showTabbar: false
    }
  },
  {
    path:'/Register',
    name:'Register',
    component:Register,
    meta:{
      requireLogin:false,
      title:'注册',
      showTabbar: false
    }
  },
  {
    path:'/market',
    name:'Market',
    component:Market,
    meta:{
      requireLogin:false,
      title:'我的',
      showTabbar: true
    }
  },
    {
      path:'/profile',
      name:'Profile',
      component:Profile,
      meta:{
        requireLogin:false,
        title:'行情',
        showTabbar: true
      }
    }
]
const router = new VueRouter({
  routes
})

export default router
